<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ page import="com.gouwudai.gobbs.pojo.TbbsRule"%>
<%@ include file="../../common/common.jsp" %>	
<%@ include file="master_pass.jsp" %>
<% 	
masterLogin.hasPermission(1002);
//权限判断代码结束
IRuleService ruleService = (IRuleService)BeanManager.getBean("ruleService");
%>

<html>
<head>
<title><%=SYSTITLE%> - 社区制度管理</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="<%=contextPath %>/scripts/prototype.js"></script>
<script language="javascript" src="<%=contextPath %>/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
var END_POINT="<%=contextPath %>/buffalo";
var buffalo = new Buffalo(END_POINT);
function update(i) {
	var p1 = $("ruleId"+i).value;	
    var p2 = $("ruleMark"+i).value;
    var p3 = $("ruleMoney"+i).value;
    var p4 = $("ruleCredit"+i).value;
    var p5 = $("ruleDeposit"+i).value;
    buffalo.remoteCall("ruleAjaxService.update",[p1,p2,p3,p4,p5], function(reply) {
    	ajaxSubmit(reply.getResult(),"保存成功！");
    });
}
</script>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#e6e6e6">
  <tr>
    <td align="center"><strong>配置默认社区制度</strong></td>
  </tr>
  <tr>
    <td><span class="style1">以下内容 加 请填写正数，减 请填写负数！</span></td>
  </tr>
</table>
<form name="form1" method="post" action="">
<table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#e6e6e6">
 <tr bgcolor="#f6f6f6">
    <td width="128" nowarp height="22" bgcolor="#f6f6f6"><strong>操作对象</strong></td>
    <td width="133"><strong>积分</strong></td>
    <td width="133"><strong>金币</strong></td>
    <td width="133"><strong>信誉</strong></td>
    <td width="133"><strong>存款</strong></td>
    <td><strong>操作</strong></td>
  </tr>
<%
List list = ruleService.listAll();
TbbsRule tbbsRule = null;
for(int i=0;i<list.size();i++)
{	
	tbbsRule = (TbbsRule)list.get(i);
%>  
    <tr bgcolor="#f6f6f6">
      <td height="22" bgcolor="#f6f6f6"><%=tbbsRule.getRuleName() %><input type="hidden" name="ruleId<%=i%>" id="ruleId<%=i%>" value="<%=tbbsRule.getRuleId()%>"></td>
      <td><input name="ruleMark<%=i%>" type="text" id="ruleMark<%=i%>"  value="<%=tbbsRule.getRuleMark()%>" size="10" maxlength="20"></td>
      <td><input name="ruleMoney<%=i%>" type="text" id="ruleMoney<%=i%>" value="<%=tbbsRule.getRuleMoney()%>" size="10" maxlength="20"></td>
      <td><input name="ruleCredit<%=i%>" type="text" id="ruleCredit<%=i%>" value="<%=tbbsRule.getRuleCredit()%>" size="10" maxlength="10"></td>
      <td><input name="ruleDeposit<%=i%>" type="text" id="ruleDeposit<%=i%>" value="<%=tbbsRule.getRuleDeposit()%>" size="10" maxlength="10"></td>
      <td><input name="save<%=i%>" type="button" id="save<%=i%>" value="更新" onclick="javascript:update(<%=i%>);"></td>
    </tr>
<%} %>
<%tbbsRule = ruleService.loadByCode("R016"); %>
    <tr bgcolor="#f6f6f6">
      <td height="22" bgcolor="#f6f6f6"><%=tbbsRule.getRuleName() %><input type="hidden" name="ruleId16" id="ruleId16" value="<%=tbbsRule.getRuleId()%>"></td>
      <td><input name="ruleMark16" type="hidden" id="ruleMark16"  value="0" size="10" maxlength="20"></td>
      <td><input name="ruleMoney16" type="hidden" id="ruleMoney16" value="0" size="10" maxlength="20"></td>
      <td><input name="ruleCredit16" type="hidden" id="ruleCredit16" value="0" size="10" maxlength="10"></td>
      <td><input name="ruleDeposit16" type="text" id="ruleDeposit16" value="<%=tbbsRule.getRuleDeposit()%>" size="10" maxlength="10"></td>
      <td><input name="save16" type="button" id="save16" value="更新" onclick="javascript:update(16);"></td>
    </tr>
<%tbbsRule = ruleService.loadByCode("R017"); %>    
    <tr bgcolor="#f6f6f6">
      <td height="22" bgcolor="#f6f6f6"><%=tbbsRule.getRuleName() %><input type="hidden" name="ruleId17" id="ruleId17" value="<%=tbbsRule.getRuleId()%>"></td>
      <td><input name="ruleMark17" type="text" id="ruleMark17"  value="<%=tbbsRule.getRuleMark()%>" size="10" maxlength="20">(N:1)</td>
      <td><input name="ruleMoney17" type="text" id="ruleMoney17" value="<%=tbbsRule.getRuleMoney()%>" size="10" maxlength="20">(1:N)</td>
      <td><input name="ruleCredit17" type="hidden" id="ruleCredit17" value="0" size="10" maxlength="10"></td>
      <td><input name="ruleDeposit17" type="hidden" id="ruleDeposit17" value="0" size="10" maxlength="10"></td>
      <td><input name="save17" type="button" id="save17" value="更新" onclick="javascript:update(17);"></td>
    </tr>      
</table>
</form>
</body>
</html>
